// 导入Vue和Vue Router
import IndexPage from '../pages/IndexPage.vue'
import LoginPage from '../pages/LoginPage.vue'
import TestPage from '../components/TestPage.vue'
import PersonPage from '../pages/PersonPage.vue'
import HabitDetailPage from '../pages/HabitDetailPage.vue'
import TargetCreatePage from '../pages/TargetCreatePage.vue'
import TargetEditPage from '../pages/TargetEditPage.vue'
import { createRouter, createWebHistory } from 'vue-router';


// 创建路由实例
const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            name: '首页',
            component: IndexPage
        },
        {
            path: '/login',
            name: '登录',
            component: LoginPage
        },
        {
            path: '/test',
            name: '测试',
            component: TestPage
        },
        {
            path: '/person',
            name: '个人',
            component: PersonPage
        },
        {
            path: '/habitDetailPage',
            name: '习惯详情页',
            component: HabitDetailPage
        },
        {
            path: '/targetCreatePage',
            name: '目标规划详情页',
            component: TargetCreatePage
        },
        {
            path: '/targetEditPage',
            name: '目标规划编辑页',
            component: TargetEditPage
        },
    ]
});

// 导出路由实例
export default router;